<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
	$(function(){
		$("#ht1").click(function(){
			if("${sessionScope.mvo}"==""||"${sessionScope.mvo}"==null){
  				alert("로그인을 해야 사용가능한 페이지입니다.");
  				return;
  			}
			location.href="happy.do?command=happyTime";	
  		});
		
		$("#ht2").click(function(){
			if("${sessionScope.mvo}"==""||"${sessionScope.mvo}"==null){
				alert("로그인 후 이용가능합니다.");
				return;
			}
			location.href="letter.do?command=letterRequest";
		});
		
		$("#ht3").click(function(){
			if("${sessionScope.mvo}"==""||"${sessionScope.mvo}"==null){
  				alert("로그인을 해야 사용가능한 페이지입니다.");
  				return;
  			}
  			location.href="optional.do?command=optionalServiceRequestWriteView";	
		});
		
		
		$("#loginBtn").click(function() {
			if ($("#loginId").val() == "") {
				alert("아이디를 입력해 주세요.");
				$("#id").focus();
				return;
			} else if ($("#loginPassword").val() == "") {
				alert("비밀번호를 입력해 주세요");
				$("#password").focus();
				return;
			}
			$("#loginForm").submit();
		});
		
		
			$("#logout_btn").click(function(){
				var f=confirm("로그아웃하시겠습니까?");
				if(f)
					location.href="wedding.do?command=logout";
					return false;
			});
			
			$("#findIdBtn").click(function(){
				window.open("member/find_id_popup.jsp","","resizable=true,toolbar=no,width=400,height=250");
			});

	});
</script>

<div style="background-image: url('${initParam.root}/img/left_form.jpg');" id="loginView">
<c:choose>
<c:when test="${sessionScope.mvo!=null}">
<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style="font-size: 12px"><b>${sessionScope.mvo.name}님 환영합니다<font color="red">♥</font></b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;행쇼에서 행복한 시간되세요!
</font><div style="height: 24px"></div>
<span style="margin-left: 36px;"><a href="wedding.do?command=logout"><img src="${initParam.root}/img/logout_btn.gif" id="logout_btn"></a>&nbsp;<a href="wedding.do?command=update"><img src="${initParam.root}/img/modify_btn.gif"></a></span><div style="height: 5px"></div>
<div style="height: 30px"></div>
</c:when>
<c:otherwise>
<br>
<form method="post" id="loginForm" action="${initParam.root}/wedding.do">
<input type="hidden" name="command" value="login">
<span style="margin-left: 24px;"><font style="font-size: 12px">아&nbsp;이&nbsp;디</font><input type="text" placeholder="아이디 입력" name="id" id="loginId" size="11"/></span><br>
<span style="margin-left: 20px;"><font style="font-size: 12px">비밀번호</font><input type="password" placeholder="비밀번호 입력" name="password" id="loginPassword" size="11"/></span><div style="height: 10px"></div>
<span style="margin-left: 36px;"><img src="${initParam.root}/img/login_btn.gif" id="loginBtn">&nbsp;<a href="wedding.do?command=registerForm"><img src="${initParam.root}/img/join_btn.gif"></a></span><div style="height: 5px"></div>
<span style="margin-left: 35px;"><img src="${initParam.root}/img/find_btn.gif" id="findIdBtn"></span>
<br><br><div style="height: 5px"></div>
</form>
</c:otherwise>
</c:choose>
</div>

<p></p>

<span id="ht1"><img src="${initParam.root}/img/left_1.jpg"></span><br>
<span id="ht2"><img src="${initParam.root}/img/left_2.jpg"></span><br>
<span id="ht3"><img src="${initParam.root}/img/left_3.jpg"></span><p></p>

<!-- 고객센터 이미지 -->
<img src="${initParam.root}/img/cs.gif"><br>

